
//
//  User.swift
//  Weibo
//
//  Created by gdarkness on 16/3/20.
//  Copyright © 2016年 gdarkness. All rights reserved.
//

import UIKit

class User: NSObject {
    //用户UID
    var id: Int64 = 0
    //会员等级0-6
    var mbrank: Int = 0
    //用户昵称
    var screen_name : String?
    //用户头像地址。50x50像素
    var profile_image_url :String?
    /// verfied_type 没有认证 -1 认证用户 0 企业认证 235 达人220
    var verified_type: Int = -1
//        didSet{
//            //生成mbrankImage，以后别人直接使用 mbrankImage
//            switch verified_type{
//            case 0:
//                verifiedTypeImage = UIImage(named: "avatar_vip")
//            case 2,3,5:
//                verifiedTypeImage = UIImage(named: "avatar_enterprise_vip")
//            case 220:
//                verifiedTypeImage = UIImage(named: "avatar_grassroot")
//            default:
//                verifiedTypeImage = nil
//            }
    
    
        
        init(dict:[String: AnyObject]){
        super.init()
        setValuesForKeysWithDictionary(dict)
        }
        override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
        
        override var description: String{
        let keys = ["id","screen_name","profile_image_url","verified_type","mbrank"]
        return "\n \t: \(dictionaryWithValuesForKeys(keys).description)"
        
        }

}
//    var mbrank: Int = 0{
//        didSet{
//            //生成mbrankImage，以后别人直接使用mbrankImage
//            if mbrank > 0 && mbrank <= 6{
//                mbrankImage = UIImage(named: "common_icon_menbership_level\(mbrank)")
//            }else{statuses
//                mbrankImage = nil
//            }
//        }
//    }
//    //MARK :-- 完善模型数据
//    //提供会员等级图片
//    var mbrankImage: UIImage?
//    //提供认证图片
//    var verifiedTypeImage : UIImage?
//    }
